﻿using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace PrismDemo.ViewModels
{
    public class MainWindowViewModel : BindableBase
    {
        public MainWindowViewModel()
        {
            Title = "绑定";
        }
        private string _title;

        public string Title
        {
            get => _title;
            //set { _title = value; RaisePropertyChanged(); }
            set => SetProperty(ref _title, value);
        }
        //有参command
        public DelegateCommand<string> TitleCommand => new DelegateCommand<string>(Show);

        private void Show(string obj)
        {
            MessageBox.Show(obj);
        }
    }
}
